@charset "utf-8";
// 清除浮动
@mixin clearfix {
  &:after {
    display: table;
    clear: both;
    content: "";
  }
}
// 弹性布局
@mixin flex {
  display: flex;
  align-items: center;
  justify-content: center;
}
// 滚动条样式
@mixin scrollBar($width: 6px) {
  ::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  ::-webkit-scrollbar {
    width: $width;
  }

  ::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }

  /* 设置滚动条的样式 */
  // &::-webkit-scrollbar {
  //   width: 10px;
  //   background-color: #fff;
  // }

  // /* 滚动槽 */
  // &::-webkit-scrollbar-track {
  //   border-radius: 10px;
  // }

  // /* 滚动条滑块 */
  // &::-webkit-scrollbar-thumb {
  //   background: #ddd;
  //   border-radius: 10px;
  // }
}
// 定位
@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}
// 背景图片
@mixin backgroundImageCover($url) {
  background: #{url($url) center center fixed no-repeat};
  background-size: cover;
}
// 背景蒙版
@mixin backgroundMask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  content: "";
  background-color: rgba(0, 0, 0, 0.5);
}
// 盒子阴影
@mixin boxShadow($color: rgba(0, 21, 41, 0.08)) {
  box-shadow: #{0 1px 4px $color};
}
@mixin pct($pct) {
  position: relative;
  width: #{$pct};
  margin: 0 auto;
}

@mixin triangle($width, $height, $color, $direction) {
  $width: $width/2;
  $color-border-style: $height solid $color;
  $transparent-border-style: $width solid transparent;
  width: 0;
  height: 0;

  @if $direction==up {
    border-bottom: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  } @else if $direction==right {
    border-left: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  } @else if $direction==down {
    border-top: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  } @else if $direction==left {
    border-right: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }
}
